package com.cy.sapling.admin.service;

import com.cy.sapling.admin.dao.AdminUserDao;
import com.cy.sapling.admin.entity.AdminUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/11/22.
 */

@RestController
public class AdminUserServiceImpl implements AdminUserService {
    @Autowired
    private AdminUserDao adminUserDao;

    @Override
    @GetMapping("/getAdminUser/{id}")
    public AdminUser getAdminUser(@PathVariable Long id) {
        return adminUserDao.getOne(id);
    }

    @Override
    @GetMapping("/getAllAdminUserList")
    public List<AdminUser> getAllAdminUserList() {
        return adminUserDao.findAll();
    }
}
